<%- include("./public/page_header.html")%>
    <link rel="stylesheet" href="/admin/css/layui.css">

    <body id="ios">

        <%- include("./public/page_nav.html")%>
            <div id="fh5co-press" data-section="testimonials">
                <div class="container">

                    <section id="newslist" style="margin-top: 50px;">
                        <div class="cat_title">
                            <div class="wrapper">
                                <div class="to-animate">
                                    <h2>新闻中心NEWS</h2>
                                    <hr>
                                </div>
                            </div>
                        </div>


                        <div class="container">
                            <ul class="news">
                                <%for(var i = 0; i < newsList.length; i++) {%>
                                    <div class="row">
                                        <div class="col-md-12 text">
                                            <div class="to-animate">
                                                <li>
                                                    <div class="newslist">
                                                        <a href="/newsContent_<%= newsList[i]._id%>.html">
                                                            <%= newsList[i].title%>
                                                        </a>

                                                        <span><%= formartTime(newsList[i].add_time)%></span>
                                                        <p>[
                                                            <a href="news.html?cid=<%= newsList[i].cid%>">
                                                                <%= newsList[i].cate[0].title%>
                                                            </a>]
                                                            <%= newsList[i].description
															%>
                                                        </p>
                                                    </div>
                                                </li>
                                            </div>
                                        </div>
                                    </div>
                                    <%}%>
                            </ul>
                    </section>
                    <div class="articalPage" id="articalPage" style="display: flex; justify-content: center;"></div>
                    </div>
                </div>

                <hr>
                <%- include("./public/page_footer.html")%>
                    <script src="/admin/js/layui.js"></script>
                    <script>
                        layui.use('laypage', function() {
                            var laypage = layui.laypage;

                            //执行一个laypage实例
                            laypage.render({
                                elem: 'articalPage', //注意，这里的 test1 是 ID，不用加 # 号
                                count: <%= count%>, //数据总数，从服务端得到
                                limit: <%= limit%>, // 每页条数， 设置了count 和 limit 后 layui会帮你计算出有多少页
                                theme: '#2080f0',
                                curr: <%= curPage%>, // 当前页
                                groups: 5, // 连续出现的页面数, 超过这个会有 ... 省略
                                jump: function(obj, first) {
                                    // 跳转服务器处理
                                    if (!first) {
                                        location.href = "news.html?page=" + obj.curr + '&cid=<%= cid%>'
                                    }
                                }
                            });
                        });
                    </script>

                    </html>